.class public Lt4j/data/DirectMessage;
.super Lt4j/TBlogResponse;
.source "DirectMessage.java"


# instance fields
.field private created_at:Ljava/util/Date;

.field private id:J

.field private recipient:Lt4j/data/User;

.field private recipient_id:J

.field private recipient_screen_name:Ljava/lang/String;

.field private sender:Lt4j/data/User;

.field private sender_id:J

.field private sender_screen_name:Ljava/lang/String;

.field private text:Ljava/lang/String;


# direct methods
.method public constructor <init>(Lt4j/http/Response;)V
    .locals 1
    .parameter "res"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 64
    invoke-direct {p0}, Lt4j/TBlogResponse;-><init>()V

    .line 65
    invoke-virtual {p1}, Lt4j/http/Response;->asJSONObject()Lt4j/org/json/JSONObject;

    move-result-object v0

    invoke-direct {p0, v0}, Lt4j/data/DirectMessage;->init(Lt4j/org/json/JSONObject;)V

    .line 66
    return-void
.end method

.method public constructor <init>(Lt4j/org/json/JSONObject;)V
    .locals 0
    .parameter "json"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 60
    invoke-direct {p0}, Lt4j/TBlogResponse;-><init>()V

    .line 61
    invoke-direct {p0, p1}, Lt4j/data/DirectMessage;->init(Lt4j/org/json/JSONObject;)V

    .line 62
    return-void
.end method

.method public static createDirectMessageList(Lt4j/http/Response;)Ljava/util/List;
    .locals 8
    .parameter "res"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lt4j/http/Response;",
            ")",
            "Ljava/util/List",
            "<",
            "Lt4j/data/DirectMessage;",
            ">;"
        }
    .end annotation

    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 160
    :try_start_0
    invoke-virtual {p0}, Lt4j/http/Response;->asJSONArray()Lt4j/org/json/JSONArray;

    move-result-object v3

    .line 161
    .local v3, list:Lt4j/org/json/JSONArray;
    invoke-virtual {v3}, Lt4j/org/json/JSONArray;->length()I

    move-result v4

    .line 162
    .local v4, size:I
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0, v4}, Ljava/util/ArrayList;-><init>(I)V

    .line 163
    .local v0, directMessages:Ljava/util/List;,"Ljava/util/List<Lt4j/data/DirectMessage;>;"
    const/4 v1, 0x0

    .local v1, i:I
    :goto_0
    if-lt v1, v4, :cond_0

    .line 166
    return-object v0

    .line 164
    :cond_0
    new-instance v6, Lt4j/data/DirectMessage;

    invoke-virtual {v3, v1}, Lt4j/org/json/JSONArray;->getJSONObject(I)Lt4j/org/json/JSONObject;

    move-result-object v7

    invoke-direct {v6, v7}, Lt4j/data/DirectMessage;-><init>(Lt4j/org/json/JSONObject;)V

    invoke-interface {v0, v6}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Lt4j/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Lt4j/TBlogException; {:try_start_0 .. :try_end_0} :catch_1

    .line 163
    add-int/lit8 v1, v1, 0x1

    goto :goto_0

    .line 167
    .end local v0           #directMessages:Ljava/util/List;,"Ljava/util/List<Lt4j/data/DirectMessage;>;"
    .end local v1           #i:I
    .end local v3           #list:Lt4j/org/json/JSONArray;
    .end local v4           #size:I
    :catch_0
    move-exception v2

    .line 168
    .local v2, jsone:Lt4j/org/json/JSONException;
    new-instance v6, Lt4j/TBlogException;

    invoke-direct {v6, v2}, Lt4j/TBlogException;-><init>(Ljava/lang/Exception;)V

    throw v6

    .line 169
    .end local v2           #jsone:Lt4j/org/json/JSONException;
    :catch_1
    move-exception v5

    .line 170
    .local v5, te:Lt4j/TBlogException;
    throw v5
.end method

.method private init(Lt4j/org/json/JSONObject;)V
    .locals 3
    .parameter "json"
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Lt4j/TBlogException;
        }
    .end annotation

    .prologue
    .line 70
    :try_start_0
    const-string v1, "id"

    invoke-virtual {p1, v1}, Lt4j/org/json/JSONObject;->getInt(Ljava/lang/String;)I

    move-result v1

    int-to-long v1, v1

    iput-wide v1, p0, Lt4j/data/DirectMessage;->id:J

    .line 71
    const-string v1, "text"

    invoke-virtual {p1, v1}, Lt4j/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lt4j/data/DirectMessage;->text:Ljava/lang/String;

    .line 72
    const-string v1, "sender_id"

    invoke-virtual {p1, v1}, Lt4j/org/json/JSONObject;->getLong(Ljava/lang/String;)J

    move-result-wide v1

    iput-wide v1, p0, Lt4j/data/DirectMessage;->sender_id:J

    .line 73
    const-string v1, "recipient_id"

    invoke-virtual {p1, v1}, Lt4j/org/json/JSONObject;->getLong(Ljava/lang/String;)J

    move-result-wide v1

    iput-wide v1, p0, Lt4j/data/DirectMessage;->recipient_id:J

    .line 74
    const-string v1, "created_at"

    invoke-virtual {p1, v1}, Lt4j/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    const-string v2, "EEE MMM dd HH:mm:ss z yyyy"

    invoke-static {v1, v2}, Lt4j/data/DirectMessage;->parseDate(Ljava/lang/String;Ljava/lang/String;)Ljava/util/Date;

    move-result-object v1

    iput-object v1, p0, Lt4j/data/DirectMessage;->created_at:Ljava/util/Date;

    .line 75
    const-string v1, "sender_screen_name"

    invoke-virtual {p1, v1}, Lt4j/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lt4j/data/DirectMessage;->sender_screen_name:Ljava/lang/String;

    .line 76
    const-string v1, "recipient_screen_name"

    invoke-virtual {p1, v1}, Lt4j/org/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    iput-object v1, p0, Lt4j/data/DirectMessage;->recipient_screen_name:Ljava/lang/String;

    .line 78
    new-instance v1, Lt4j/data/User;

    const-string v2, "sender"

    invoke-virtual {p1, v2}, Lt4j/org/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lt4j/org/json/JSONObject;

    move-result-object v2

    invoke-direct {v1, v2}, Lt4j/data/User;-><init>(Lt4j/org/json/JSONObject;)V

    iput-object v1, p0, Lt4j/data/DirectMessage;->sender:Lt4j/data/User;

    .line 79
    new-instance v1, Lt4j/data/User;

    const-string v2, "recipient"

    invoke-virtual {p1, v2}, Lt4j/org/json/JSONObject;->getJSONObject(Ljava/lang/String;)Lt4j/org/json/JSONObject;

    move-result-object v2

    invoke-direct {v1, v2}, Lt4j/data/User;-><init>(Lt4j/org/json/JSONObject;)V

    iput-object v1, p0, Lt4j/data/DirectMessage;->recipient:Lt4j/data/User;
    :try_end_0
    .catch Lt4j/org/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 84
    return-void

    .line 81
    :catch_0
    move-exception v0

    .line 82
    .local v0, e:Lt4j/org/json/JSONException;
    new-instance v1, Lt4j/TBlogException;

    invoke-direct {v1, v0}, Lt4j/TBlogException;-><init>(Ljava/lang/Exception;)V

    throw v1
.end method


# virtual methods
.method public getCreatedAt()Ljava/util/Date;
    .locals 1

    .prologue
    .line 119
    iget-object v0, p0, Lt4j/data/DirectMessage;->created_at:Ljava/util/Date;

    return-object v0
.end method

.method public getId()J
    .locals 2

    .prologue
    .line 87
    iget-wide v0, p0, Lt4j/data/DirectMessage;->id:J

    return-wide v0
.end method

.method public getRecipient()Lt4j/data/User;
    .locals 1

    .prologue
    .line 151
    iget-object v0, p0, Lt4j/data/DirectMessage;->recipient:Lt4j/data/User;

    return-object v0
.end method

.method public getRecipientId()J
    .locals 2

    .prologue
    .line 111
    iget-wide v0, p0, Lt4j/data/DirectMessage;->recipient_id:J

    return-wide v0
.end method

.method public getRecipientScreenName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 135
    iget-object v0, p0, Lt4j/data/DirectMessage;->recipient_screen_name:Ljava/lang/String;

    return-object v0
.end method

.method public getSender()Lt4j/data/User;
    .locals 1

    .prologue
    .line 143
    iget-object v0, p0, Lt4j/data/DirectMessage;->sender:Lt4j/data/User;

    return-object v0
.end method

.method public getSenderId()J
    .locals 2

    .prologue
    .line 103
    iget-wide v0, p0, Lt4j/data/DirectMessage;->sender_id:J

    return-wide v0
.end method

.method public getSenderScreenName()Ljava/lang/String;
    .locals 1

    .prologue
    .line 127
    iget-object v0, p0, Lt4j/data/DirectMessage;->sender_screen_name:Ljava/lang/String;

    return-object v0
.end method

.method public getText()Ljava/lang/String;
    .locals 1

    .prologue
    .line 95
    iget-object v0, p0, Lt4j/data/DirectMessage;->text:Ljava/lang/String;

    return-object v0
.end method

.method public setCreatedAt(Ljava/util/Date;)V
    .locals 0
    .parameter "created_at"

    .prologue
    .line 123
    iput-object p1, p0, Lt4j/data/DirectMessage;->created_at:Ljava/util/Date;

    .line 124
    return-void
.end method

.method public setId(J)V
    .locals 0
    .parameter "id"

    .prologue
    .line 91
    iput-wide p1, p0, Lt4j/data/DirectMessage;->id:J

    .line 92
    return-void
.end method

.method public setRecipient(Lt4j/data/User;)V
    .locals 0
    .parameter "recipient"

    .prologue
    .line 155
    iput-object p1, p0, Lt4j/data/DirectMessage;->recipient:Lt4j/data/User;

    .line 156
    return-void
.end method

.method public setRecipientId(J)V
    .locals 0
    .parameter "recipient_id"

    .prologue
    .line 115
    iput-wide p1, p0, Lt4j/data/DirectMessage;->recipient_id:J

    .line 116
    return-void
.end method

.method public setRecipientScreenName(Ljava/lang/String;)V
    .locals 0
    .parameter "recipient_screen_name"

    .prologue
    .line 139
    iput-object p1, p0, Lt4j/data/DirectMessage;->recipient_screen_name:Ljava/lang/String;

    .line 140
    return-void
.end method

.method public setSender(Lt4j/data/User;)V
    .locals 0
    .parameter "sender"

    .prologue
    .line 147
    iput-object p1, p0, Lt4j/data/DirectMessage;->sender:Lt4j/data/User;

    .line 148
    return-void
.end method

.method public setSenderId(J)V
    .locals 0
    .parameter "sender_id"

    .prologue
    .line 107
    iput-wide p1, p0, Lt4j/data/DirectMessage;->sender_id:J

    .line 108
    return-void
.end method

.method public setSenderScreenName(Ljava/lang/String;)V
    .locals 0
    .parameter "sender_screen_name"

    .prologue
    .line 131
    iput-object p1, p0, Lt4j/data/DirectMessage;->sender_screen_name:Ljava/lang/String;

    .line 132
    return-void
.end method

.method public setText(Ljava/lang/String;)V
    .locals 0
    .parameter "text"

    .prologue
    .line 99
    iput-object p1, p0, Lt4j/data/DirectMessage;->text:Ljava/lang/String;

    .line 100
    return-void
.end method
